package com.example.spring_aop.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Li_yizYa
 * Date: 2025/7/23
 * Time: 17:53
 */
@Slf4j
//@Component
@Aspect
@Order(1) // 定义级别，数字越大，优先级越低
public class AspectDemo4 {

    @Pointcut("execution(* com.example.spring_aop.controller.*.*(..))")
    public void pt() {

    }
    @Before("pt()")
    public void doBefore() {
        log.info("AspectDemo4 执行doBefore...");
    }

    @After("pt()")
    public void doAfter() {
        log.info("AspectDemo4 执行doAfter...");
    }
}
